package com.action
{
	import com.logic.battle.BattleLogic;
	import com.resource.animation.Animation;
	import com.resource.animation.AnimationCacher;
	import com.stage.item.Player;
	import com.utils.time.TimerClock;
	
	import mx.core.Application;

	public class ActionBullet extends BaseAction
	{
		protected var _bulletId:int;
		protected var _anima:Animation;
		protected var _distance:Number; // 水平射程
		protected var _skillId:String;
		protected var _upSpeed:Number; // 垂直速度，复杂的子弹，如散弹可以用动画实现

		public function ActionBullet(player:Player, data:Object)
		{
			super(player, data);
			_bulletId = data.bulletId;
			_dir = data.dir;
			_skillId = data.skillId;
			var dat:Object = AnimationCacher.getInstance().getAnimation("res/bullet.dat")
			_anima = new Animation(dat);
			Application.application.container.addChild(_anima);
			_anima.x = data.x;
			_anima.y = data.y;
			_anima.scaleX = dir;
			
			_speed = 20;
			_distance = 500;
			_upSpeed = -5;
		}
		
		public function get animation():Animation{
			return _anima;
		}
		
		public function get bulletId():int{
			return _bulletId;
		}
		
		public function get skillId():String{
			return _skillId;
		}
	}
}